<template>
  <div class="add_payFee_people_template">
    <!--面包屑导航模板-->
    <el-breadcrumb class="topNav" separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/payFee_save/payFee_save'}">缴费信息维护</el-breadcrumb-item>
      <el-breadcrumb-item :to="{path:'/payFee_save/payFee_save'}">缴费人员管理</el-breadcrumb-item>
      <el-breadcrumb-item>新增操作员</el-breadcrumb-item>
    </el-breadcrumb>
    <!--标题模板-->
    <el-row>
      <el-col :span="24"><div class="title-template">增加用户</div></el-col>
    </el-row>

    <!--form表单模板（带验证）-->
    <el-form
      class="add-template-form"
      :rules="rules"
      ref="form"
      :model="form"
      label-width="200px"
      :label-position="labelPosition">

      <!--文本框模板-->
      <el-form-item label="用户姓名：" prop="user_name">
        <el-input v-model="form.user_name" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="缴费编号：" prop="pay_number">
        <el-input v-model="form.pay_number" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="联系方式：" prop="contact_way">
        <el-input v-model="form.contact_way" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="所属机构：" prop="attach_org">
        <el-input v-model="form.attach_org" style="width: 30%;"></el-input>
      </el-form-item>

      <!--下拉框模板-->
      <el-form-item label="性别：" prop="gender">
        <el-select v-model="form.gender" placeholder="请选择项目类型" style="width: 30%;">
          <el-option label=请选择 value=""></el-option>
          <el-option label="男" value="shanghai"></el-option>
          <el-option label="女" value="beijing"></el-option>
        </el-select>
      </el-form-item>

      <!--文本框模板-->
      <el-form-item label="身份证号：" prop="IDCard" class="normalBox">
        <el-input v-model="form.IDCard" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="家庭地址：" prop="address" class="normalBox">
        <el-input v-model="form.address" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="联系人：" prop="linkman" class="normalBox">
        <el-input v-model="form.linkman" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="联系人电话：" prop="phoneNumber" class="normalBox">
        <el-input v-model="form.phoneNumber" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="备注1：" prop="remarks1" class="normalBox">
        <el-input v-model="form.remarks1" style="width: 30%;"></el-input>
      </el-form-item>
      <!--文本框模板-->
      <el-form-item label="备注2：" prop="remarks2" class="normalBox">
        <el-input v-model="form.remarks2" style="width: 30%;"></el-input>
      </el-form-item>

      <!--按钮模板-->
      <el-form-item>
        <el-button type="primary"  @click="submitForm('form')">保存</el-button>
        <el-button class="btn-item-cancel"  @click="resetForm('form')">重置</el-button>
      </el-form-item>
    </el-form>

  </div>
</template>

<script>

  export default {
    data(){
      return{

        labelPosition:'left',
        form: {
          user_name: '',
          pay_number:'',
          contact_way:'',
          attach_org:'',
          gender:'',
          IDCard:'',
          address:'',
          linkman:'',
          phoneNumber:'',
          remarks1:'',
          remarks2:'',
          checkList:[],
          checkAll:false,
          isIndeterminate: true
        },
        rules: {
          user_name: [
            { required: true, message: '请输入姓名', trigger: 'blur' }
          ],
          pay_number: [
            { required: true, message: '请填写缴费编号', trigger: 'blur' }
          ],
          contact_way: [
            {required: true, message: '请填写联系方式', trigger: 'blur' }
          ],
          attach_org: [
            { required: true, message: '请选择所属机构', trigger: 'change' }
          ],
          gender: [
            { required: true, message: '请选择性别', trigger: 'change' }
          ]
        },

      }
    },
    methods:{
      submitForm(formName) {
//        this.$refs[formName].validate((valid) => {
        this.$refs[formName].validate(
          function(valid) {
            if (valid) {
              alert('submit!');
            } else {
//            console.log('error submit!!');
              return false;
            }
          });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      },
    }
  }
</script>

<style>
  .add_payFee_people_template .topNav{
    margin-left: 30px;
    margin-bottom: 20px;
  }
  .add_payFee_people_template .title-template{
    height: 60px;
    line-height: 60px;
    font-size: 18px;
    padding-left: 30px;
    margin-bottom: 10px;
    color: #333333;
    background: #ffffff;

  }

  .add_payFee_people_template .add-template-form{
    background: #ffffff;
    padding: 50px 30px;
  }
  .add_payFee_people_template .add-template-form label.el-form-item__label{
    font-size: 16px;
    color: #666666;
  }
  .add_payFee_people_template .add-template-form .el-form-item{
    margin-bottom: 50px;
  }
  .add_payFee_people_template .add-template-form .btn-item-cancel{
    margin-left: 100px;
  }
  .add_payFee_people_template .checkbox-child{
    margin-left: 50px;
  }
  .add_payFee_people_template .normalBox.is-required .el-form-item__label:before{
    visibility: hidden;
  }
</style>
